﻿/*
#**************************************************************************
#  openSIS is a student information system for public and non-public 
#  schools from Open Solutions for Education, Inc. web: www.os4ed.com
#
#  openSIS is  web-based, open source, and comes packed with features that 
#  include student demographic info, scheduling, grade book, attendance, 
#  report cards, eligibility, transcripts, parent portal, 
#  student portal and more.   
#
#  Visit the openSIS web site at http://www.opensis.com to learn more.
#  If you have question regarding this system or the license, please send 
#  an email to info@os4ed.com.
#
#  This program is released under the terms of the GNU General Public License  
#  as  published by the Free Software Foundation, version 2 of the License. 
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#**************************************************************************** 

*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using OpenSISPeriodDataLayer;

namespace OpenSISPeriodBusinessLayer
{
    public class PeriodBL
    {
        private int schperiodid;
        private int schid;
        private string title;
        private string shortname;
        private string shortorder;
        private int length;
        private string block;
        private string useatted;
        private string starttime;
        private string endtime;

        public PeriodBL()
        {
            schperiodid = 0;
            schid = 0;
            title = "";
            shortname = "";
            shortorder = "";
            length = 0;
            block = "";
            useatted = "";
            starttime = "";
            endtime = "";

        }

        public int SchPeriodId
        {
            get
            {
                return this.schperiodid;
            }
            set
            {
                this.schperiodid = value;
            }
        }

        public int SchId
        {
            get
            {
                return this.schid;
            }
            set
            {
                this.schid = value;
            }
        }

        public String Title
        {
            get
            {
                return this.title;
            }
            set
            {
                this.title = value;
            }
        }

        public String ShortName
        {
            get
            {
                return this.shortname;
            }
            set
            {
                this.shortname = value;
            }
        }

        public String ShortOrder
        {
            get
            {
                return this.shortorder;
            }
            set
            {
                this.shortorder = value;
            }
        }

        public int Length
        {
            get
            {
                return this.length;
            }
            set
            {
                this.length = value;
            }
        }

        public String Block
        {
            get
            {
                return this.block;
            }
            set
            {
                this.block = value;
            }
        }

        public String UseAtted
        {
            get
            {
                return this.useatted;
            }
            set
            {
                this.useatted = value;
            }
        }

        public String StartTime
        {
            get
            {
                return this.starttime;
            }
            set
            {
                this.starttime = value;
            }
        }

        public String EndTime
        {
            get
            {
                return this.endtime;
            }
            set
            {
                this.endtime = value;
            }
        }

        public System.Data.DataTable PopulateSchoolPeriod()
        {
            DataTable dt = null;
            PeriodDL SPDL = new PeriodDL();
            dt = SPDL.SchoolPeriodDetails(this);
            return dt;
        }

        public void AddSchoolPeriod()
        {
            PeriodDL SPDL = new PeriodDL();
            SPDL.AddSchoolPeriod(this);
        }

        public void UpdatePeriod()
        {
            PeriodDL SPDL = new PeriodDL();
            SPDL.UpdateSchoolPeriod(this);
        }

        public void UpdateShortOrder()
        {
            PeriodDL SPDL = new PeriodDL();
            SPDL.UpdateSchoolPeriodShortOrder(this);
        }

        public void DeletePeriod()
        {
            PeriodDL SPDL = new PeriodDL();
            SPDL.DeleteSchoolPeriod(this);
        }

    }
}
